package com.efast.dmom.mes.util;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.efast.dmom.mes.dao.entity.DmomIdDao;

@Component
public class IdUtil {
	@Autowired
	private  DmomIdDao dmomIdDao;
	
	private static IdUtil idUtil;
	
	@PostConstruct
    public void init() {
		idUtil = this;
    }
	
	public static long getDmomId() {
		//平台ID，数据库唯一
		return idUtil.dmomIdDao.getDmomId();
	}
	public static int getDmomPid() {
		//平台PID
		return idUtil.dmomIdDao.getDmomPid();
	}
	public static int increaseDmomPid() {
		//平台PID,增加pid
		return idUtil.dmomIdDao.updateDmomPid();
	}
	public static int getSiteId() {
		return 0;
	}
	public static long getTrxId() {
		
		return 1;
	}
}
